<tagLib name="html" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改收支</title>
	<include file="Public:header" />
	<style type="text/css">
		.input{width:190px; border:1px solid #ccc; padding:2px;}
		.textarea{width:500px; height:100px; border:1px solid #ccc; padding:2px;}
		.select{width:190px; border:1px solid #ccc; height:25px; padding:2px;}
	</style>
	<script type="text/javascript">
		function chkfrm()
		{
			if($('input=name[fadate]').val()=='')
			{
				$.messager.show({title:'提示',msg:'请选择日期',timeout:5000,showType:'slide'});
				return false;
			}
			if($('#amount').val()=='')
			{
				$.messager.show({title:'提示',msg:'请输入金额',timeout:5000,showType:'slide'});
				return false;
			}
			if(isNaN($('#amount').val()))
			{
				$.messager.show({title:'提示',msg:'金额只能为数字',timeout:5000,showType:'slide'});
				return false;
			}
			if($('#comment').val()=='')
			{
				$.messager.show({title:'提示',msg:'请输入说明',timeout:5000,showType:'slide'});
				return false;
			}
			return true;
		}
	</script>
</head>
<body class="">
	<div class="demo-info space-out-10px">
		<div class="demo-tip icon-tip"></div>
		<div>修改<if condition="($mas_code EQ 'INCOME')">收入<else/>支出</if>
		<if condition="($mydata['status_flg'] EQ 'P') OR ($mydata['status_flg'] EQ 'N')">&nbsp;&nbsp;--&nbsp;&nbsp;单据状态【{$mydata.status_flg|get_status_title=###,true}】的修改只会保存备注</if>
		</div>
	</div>
	<form id="form1" method="post" action="{:U('Faotherio/data_edit_save')}" onsubmit="return chkfrm()">
	
	<ul class="idTabs space-out-10px"> 
		<li><a href="#tabs_basic">基本信息</a></li>
	</ul>
	<div id="tabs_basic">
		<table class="space-out-10px">
		<tr>
		<td style="width:100px;">日期：</td><td><input type="text" id="fadate" name="fadate" value="{$mydata.fadate|date='Y-m-d',###}" class="easyui-datebox input" editable="false" /></td>
		</tr>
		
		<tr>
		<td>金额：</td><td><input type="text" id="amount" name="amount" value="{$mydata.amount}" class="easyui-validatebox input" required="true" /></td>
		</tr>
		
		<tr>
		<td>说明：</td><td><textarea type="text" id="comment" name="comment" class="textarea">{$mydata.comment}</textarea></td>
		</tr>
		
		<tr>
		<td>备注：<br/><i>任何状态下<br/>都可以修改</i></td><td><textarea type="text" id="remark" name="remark" class="textarea">{$mydata.remark}</textarea></td>
		</tr>
		
		<tr>
		<td><if condition="($mydata['mas_code'] EQ 'INCOME')">收入到<else/>支出从</if>：</td>
		<td>
		<select id="bank" name="bank" class="easyui-combobox" editable="false">
		<volist id="bank_list" name="bank_list">		
		<option value="{$bank_list['code']}" <if condition="($mydata['bank'] EQ $bank_list['code'])">selected</if> />{$bank_list['title']}</option>		
		</volist>
		</select>
		</td>
		</tr>
		
		</table>		

		
	</div>
	
	
		<table class="space-out-10px">
		<tr>
		<td>&nbsp;</td><td>&nbsp;</td>
		</tr>
		<tr>
		<td>&nbsp;</td><td>
		<input type="hidden" id="id" name="id" value="{$mydata.id}" />
		<input type="hidden" id="mas_code" name="mas_code" value="{$mydata.mas_code}" />
		<input type="hidden" id="status_flg" name="status_flg" value="{$mydata.status_flg}" />
		<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-save" onclick="$('#form1').submit();">保存</a>
		<a href="{:U('Faotherio/data_list')}" class="easyui-linkbutton" iconCls="icon-undo">取消</a>
		</td>
		</tr>
		</table>
		

	</form>

</body>
</html>
